#pragma once
#include "my_header.h"
#include <mysql/mysql.h>
#include "taskQueue.h"
#include "transFile.h"
#include <stdarg.h>
#include <time.h>

typedef struct _tidArr_s{
    pthread_t* _arr;
    int _worker_num;
}_tidArr_t;

typedef struct threadPool_s{
    _taskQueue_t _q;
    _tidArr_t _tidArr;
    pthread_mutex_t _mutex;
    pthread_cond_t _cond;
    int _exitFlag;
}threadPool_t;


void _tidArr_init(_tidArr_t* tidArr, int workerNum);

// 初始化并启动
void threadPool_init(threadPool_t* pool, int workerNum);

